<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>LONGCMS V 1.0</title>

		<meta name="description" content="Dashboard">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script src="/Public/admin/js/jquery-1.3.2.min.js"></script>

		<!--Basic Styles-->
		<link href="/Public/admin/css/bootstrap.css" rel="stylesheet">
		<link href="/Public/admin/css/font-awesome.css" rel="stylesheet">
		<link href="/Public/admin/css/weather-icons.css" rel="stylesheet">

		<!--Beyond styles主题框架-->
		<link id="beyond-link" href="/Public/admin/css/beyond.css" rel="stylesheet" type="text/css">
		<link href="/Public/admin/css/demo.css" rel="stylesheet">
		<link href="/Public/admin/css/typicons.css" rel="stylesheet">
		<link href="/Public/admin/css/animate.css" rel="stylesheet">
		<!--自己定义-->

		<link href="/Public/admin/css/style.css" rel="stylesheet">

	</head>

	<body>
		<!--面包屑 start-->

		<nav class="breadcrumb"><i class="glyphicon glyphicon-home"></i> 首页 <span class="c-gray en">&gt;</span> 管理员管理 <span class="c-gray en">&gt;</span> 角色列表
			<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px; display: block; float: right; margin-right: 15px;" href="javascript:location.replace(location.href);" title="刷新"><i class="glyphicon glyphicon-repeat	"></i></a>
		</nav>
		<!--面包屑 over-->
	<form method="post" action="/index.php/Admin/Auth/auth_del_all" >

		<div class="page-container">
			<div class="seach">
				<div class="col-lg-6">
					<div class="input-group">
						<input type="text" class="form-control">
						<span class="input-group-btn">
                        <button class="btn btn-default" type="button"><i class="glyphicon glyphicon-search"></i></button>
                    </span>
					</div>
				</div>
			</div>
			<div class="bk-gray">
<input type="submit" class="btn btn-danger" value="X 批量删除"/>


				<a href="/index.php/Admin/Auth/auth_add" class="btn btn-success">
					<i class="glyphicon glyphicon-plus"></i> 添加角色</a>

			</div>

				<table class="table table-bordered table-hover">
					<thead>
						<tr>
							<th scope="col" colspan="9" class="text-l">角色列表</th>
						</tr>
						<tr class="text-c">
							<th width="45">
								<input type="checkbox" id="all">
							</th>
							<th width="40">ID</th>
							<th>角色名称</th>

							<th width="100">操作</th>
						</tr>
					</thead>
			<div id="list">
					
					<tbody id="list">
						<?php if(is_array($authlist)): $i = 0; $__LIST__ = $authlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">
								<td><input class="" type="checkbox" name="id[]" value="<?php echo ($vo["id"]); ?>" /></td>
								<td><?php echo ($vo["id"]); ?></td>
								<td><?php echo ($vo["authname"]); ?></td>
								<td class="td-manage">
									<a title="编辑" href="/index.php/Admin/Auth/auth_edit/id/<?php echo ($vo["id"]); ?>" class="ml-5" style="text-decoration:none"><i class="glyphicon glyphicon-pencil"></i></a>
									<a title="删除" href="/index.php/Admin/Auth/auth_del/id/<?php echo ($vo["id"]); ?>" onclick="return confirm('你要删除该角色吗？');" class="ml-5" style="text-decoration:none"><i class="glyphicon glyphicon-trash	"></i></a>
								</td>
							</tr><?php endforeach; endif; else: echo "" ;endif; ?>

					</tbody>
			</div>
					
				</table>

		</div>
		<div class="btn-l">
			<h4>
			<input type="button" value="全选" class="btn-xs btn" id="selectAll">
			<input type="button" value="全不选" class="btn-xs btn" id="unSelect">
			<input type="button" value="反选" class="btn-xs btn" id="reverse">
			<!-- <input type="button" value="获得选中的所有值" class="btn-xs btn" id="getValue"> -->
			</h4>
		</div>
		<ul class="pagination">
			<?php echo ($page); ?>
		</ul>
	</form>
		


		<script>
			<!--
			$(function() {
				//全选或全不选 
				$("#all").click(function() {
					if(this.checked) {
						$("#list :checkbox").attr("checked", true);
					} else {
						$("#list :checkbox").attr("checked", false);
					}
				});
				//全选   
				$("#selectAll").click(function() {
					$("#list :checkbox,#all").attr("checked", true);
				});
				//全不选 
				$("#unSelect").click(function() {
					$("#list :checkbox,#all").attr("checked", false);
				});
				//反选  
				$("#reverse").click(function() {
					$("#list :checkbox").each(function() {
						$(this).attr("checked", !$(this).attr("checked"));
					});
					allchk();
				});

				//设置全选复选框 
				$("#list :checkbox").click(function() {
					allchk();
				});

				//获取选中选项的值 
				$("#getValue").click(function() {
					var valArr = new Array;
					$("#list :checkbox[checked]").each(function(i) {
						valArr[i] = $(this).val();
					});
					var vals = valArr.join(',');
					alert(vals);
				});
			});

			function allchk() {
				var chknum = $("#list :checkbox").size(); //选项总个数 
				var chk = 0;
				$("#list :checkbox").each(function() {
					if($(this).attr("checked") == true) {
						chk++;
					}
				});
				if(chknum == chk) { //全选 
					$("#all").attr("checked", true);
				} else { //不全选 
					$("#all").attr("checked", false);
				}
			}
		</script>

	</body>

</html>